<template>
  <div class="show-container">
    <div class="show-header">
      <a @click="back">
        <Icon type="md-arrow-back" size="22" color="#1e9fff" />
      </a>
      <h4 class="title">{{ title }}</h4>
    </div>
    <div class="content">
      <slot />
    </div>
  </div>
</template>
<script>
import { mapActions } from "vuex";
export default {
  name: "show-container",
  props: {
    title: {
      type: String,
      default: "标题"
    }
  },
  methods: {
    ...mapActions({
      delTags: "tagsView/delTag",
      setRefreshStatus: "tagsView/setRefreshStatus"
    }),
    back() {
      this.delTags(this.$route.path).then(() => {
        this.$router.go(-1);
      });
    },
    refresh() {
      this.delTags(this.$route.path).then(() => {
        this.$router.go(-1);
        this.setRefreshStatus(true);
      });
    }
  }
};
</script>
<style lang="scss" scoped></style>
